package com.yami.shop.user.common.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yami.shop.bean.vo.UserVO;
import com.yami.shop.bean.vo.UserXsCardVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author yami
 */
@Data
@TableName( "tz_user_balance_withdraw_cash")
public class UserBalanceWithdrawCash {

    @TableId(type = IdType.INPUT)
    @Schema(description = "提现记录id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long withdrawCashId;

    @Schema(description = "钱包id")
    private Long walletId;

    @Schema(description = "金额")
    private Double amount;

    @Schema(description = "手续费")
    private Double fee;

    @Schema(description = "类型(0 手动提现 1自动提现)")
    private Integer type;

    @Schema(description = "资金流向(1企业付款到微信零钱 2用户新生账户付款到银行卡)")
    private Integer moneyFlow;

    @Schema(description = "流水号")
    private String merchantOrderId;

    @Version
    @Schema(description = "乐观锁")
    private Integer version;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Schema(description = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Schema(description = "审核时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auditingTime;

    @Schema(description = "提现状态(0:申请中 1:提现成功 2:拒绝提现 -1:提现失败)")
    private Integer state;

    @Schema(description = "第三方登录userId")
    private String bizUserId;

    @Schema(description = "审核人id")
    private Long auditorId;

    @Schema(description = "用户id")
    private String userId;

    @Schema(description = "关联用户")
    @TableField(exist = false)
    private UserVO userVO;

    @Schema(description = "关联用户卡信息")
    @TableField(exist = false)
    private UserXsCardVO userXsCardVO;

    @Schema(description = "排序字段 提现记录：0无 1金额 2手续费 3提现时间 4更新时间")
    @TableField(exist = false)
    private Integer sortParam = 0;

    @Schema(description = "排序类型 0无 1 正序 2倒序")
    @TableField(exist = false)
    private Integer sortType = 0;

    @Schema(description = "绑卡协议号")
    private String bindCardAgrNo;
}
